package com.t235.gc.order.controller;

import com.t235.gc.AjaxResult;
import com.t235.gc.order.service.OrderService;
import com.t235.gc.orderVo.GarbageRecyclingOrderVo;
import com.t235.gc.orderVo.GoodsOrderVo;
import com.t235.gc.orderVo.HomeRecyclingOrderVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/order")
@Api(tags = "订单接口")
@CrossOrigin
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/garbageRecyclingOrder")
    @ApiOperation(value = "垃圾回收订单查询",notes = "一系列条件查询")
    public AjaxResult findByGarbageRecyclingOrderVo(GarbageRecyclingOrderVo vo){
        return AjaxResult.success(orderService.findByGarbageRecyclingOrderVo(vo));
    }

    @GetMapping("/homeRecyclingOrder")
    @ApiOperation(value = "上门回收订单查询",notes = "一系列条件查询")
    public AjaxResult findByHomeRecyclingOrderVo(HomeRecyclingOrderVo vo){
        return AjaxResult.success(orderService.findByHomeRecyclingOrderVo(vo));
    }

    @GetMapping("/goodsOrder")
    @ApiOperation(value = "商品订单查询",notes = "一系列条件查询")
    public AjaxResult findByGoodsOrderVo(GoodsOrderVo vo){
        return AjaxResult.success(orderService.findByGoodsOrderVo(vo));
    }
}
